@function grid-width($count, $gutter, $width) {
  @return ($count - 1) * $gutter + ($count * $width);
}

@function context-width($context, $gutter, $width) {
  @return $context * ($width + $gutter);
}

@mixin the-grid($count, $context: 12, $width: 60, $gutter: 20) {
  width: percentage(grid-width($count, $gutter, $width) / context-width($context, $gutter, $width));
}

.block {
  @include the-grid(6);
}